FUNCTION
list.sub
Returns a sublist of this list starting from the specified index (inclusive).
Equivalent to list.sub(index, list.size()).
Note that:
my_list.sub(my_list.size() - 1)returns a list containing only the last element ofmy_list(assumingmy_list.size > 0)my_list.sub(my_list.size())returns an empty listmy_list.sub(my_list.size() + 1)throws an exception
Parameters
- start — the starting index of the sublist (inclusive)
Throws
exception— if thestartindex greater than this list's size
Since
0.6.0
Returns a sublist of this list starting from the specified start index (inclusive) to the specified end index (exclusive).
For the list my_list, my_list.sub(start, my_list.size()) is equivalent to my_list.sub(start).
Parameters
- start — the start index of the sublist (inclusive)
- end — the end index of the sublist (exclusive)
Throws
exception— when: - thestartorendindexes are greater than this list's size - thestartindex is greater than theendindex
Since
0.6.0
© 2026 Chromia